package com.whj.apipassenger.controller;

import com.whj.apipassenger.service.TokenService;
import com.whj.internalcommon.dto.ResponseResult;
import com.whj.internalcommon.response.TokenResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: wanghaijun
 * @Date: 2023/1/2 - 01 - 02 - 16:09 
 * @Description: com.whj.apipassenger.controller
 */

@RestController
public class TokenController {

    @Autowired
    private TokenService tokenService;

    @PostMapping("/token-refresh")
    public ResponseResult refreshToken(@RequestBody TokenResponse tokenResponse){

        return tokenService.refreshToken(tokenResponse.getRefreshToken());
    }
}
